package com.dbh.design.strategy;

import com.dbh.design.strategy.entity.QuackBehavior;

/**
 * @author dongbanghui
 * @date 2021/3/26
 */
public class Duck {

    private QuackBehavior quackBehavior;

    public void preformQuack() {
        if (quackBehavior != null) {
            quackBehavior.quack();
        }
    }

    public void setQuackBehavior(QuackBehavior quackBehavior) {
        this.quackBehavior = quackBehavior;
    }
}
